calc_arbre := proc(a::list)	local n, i, noeud, gauche, droit;	n := nops(a);	if n=1 then return [x-a[1]]:	else		noeud := mul(x-a[i], i=1..n);		gauche := [seq(a[i], i=1..n/2)];		droit := [seq(a[i], i=(n/2)+1..n)];		return [noeud, calc_arbre(gauche), calc_arbre(droit)];	fi;
end proc;

division := proc (a, b ,c)	local delta, m, r, tmp, x, q, res;	m := 0;	r := a;	x := c;	while degree(r)>=degree(b) do		delta := degree(r)-degree(b);		tmp := (lcoeff(r)/lcoeff(B))*X^delta;		m := expand(m + tmp);	r := expand(r - (tmp*b));	od;	q := m;	res := r;	(q, res);end;